package com.tdkj.model.shop;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.tdkj.model.base.BaseEntity;
import com.tdkj.model.user.BeanUser;

/**
 * Shop entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "shop_shop")
public class BeanShop extends BaseEntity {

	private String name;
	private String iconUrl;
	private String businessScope;
	private String description;
	private Date createDate;
	private String state;
	private int creditScore;
	private BeanCreditRating creditRating;
	private BeanUser user;
	
	private List<BeanShelf> shelfs;
	
	private List<BeanShopFriendlyLink> links;
	
	private List<BeanShopComment> comments;
	
	private BeanGoodShowcase showcase;

	private BeanShopRecommendationUseInfo shopRecommendationUseInfo;
	
	private BeanShopDecorateInfo decorateInfo;
	
	private BeanShopDecorateInfo decorateInfoTemp;
	
	private String background ;
	
	public String getBackground() {
		return background;
	}

	public void setBackground(String background) {
		this.background = background;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	/**
	 * @return the user
	 */
	@OneToOne(fetch=FetchType.EAGER, cascade={CascadeType.REFRESH}, mappedBy="shop")
	public BeanUser getUser() {
		return user;
	}

	/**
	 * @param user the user to set
	 */
	public void setUser(BeanUser user) {
		this.user = user;
	}


	@OneToMany(fetch=FetchType.LAZY, cascade={CascadeType.ALL}, mappedBy="shop")
	public List<BeanShopFriendlyLink> getLinks() {
		return links;
	}

	public void setLinks(List<BeanShopFriendlyLink> links) {
		this.links = links;
	}

	@OneToMany(fetch=FetchType.LAZY, cascade={CascadeType.ALL}, mappedBy="shop")
	public List<BeanShelf> getShelfs() {
		return shelfs;
	}

	public void setShelfs(List<BeanShelf> shelfs) {
		this.shelfs = shelfs;
	}

	@OneToMany(fetch=FetchType.LAZY, cascade={CascadeType.ALL}, mappedBy="shop")
	public List<BeanShopComment> getComments() {
		return comments;
	}

	public void setComments(List<BeanShopComment> comments) {
		this.comments = comments;
	}

	@OneToOne(fetch=FetchType.LAZY, cascade={CascadeType.ALL})
	@JoinColumn(name="showcase_id")
	public BeanGoodShowcase getShowcase() {
		return showcase;
	}

	public void setShowcase(BeanGoodShowcase showcase) {
		this.showcase = showcase;
	}

	public String getIconUrl() {
		return iconUrl;
	}

	public void setIconUrl(String iconUrl) {
		this.iconUrl = iconUrl;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getBusinessScope() {
		return businessScope;
	}

	public void setBusinessScope(String businessScope) {
		this.businessScope = businessScope;
	}

	@OneToOne(fetch=FetchType.LAZY, cascade={CascadeType.REFRESH},mappedBy="shop")
	public BeanShopRecommendationUseInfo getShopRecommendationUseInfo() {
		return shopRecommendationUseInfo;
	}

	public void setShopRecommendationUseInfo(
			BeanShopRecommendationUseInfo shopRecommendationUseInfo) {
		this.shopRecommendationUseInfo = shopRecommendationUseInfo;
	}

	@OneToOne(fetch=FetchType.EAGER, cascade={CascadeType.ALL})
	@JoinColumn(name="decorate_info_id")
	public BeanShopDecorateInfo getDecorateInfo() {
		return decorateInfo;
	}

	public void setDecorateInfo(BeanShopDecorateInfo decorateInfo) {
		this.decorateInfo = decorateInfo;
	}

	@OneToOne(fetch=FetchType.EAGER, cascade={CascadeType.ALL})
	@JoinColumn(name="decorate_info_temp_id")
	public BeanShopDecorateInfo getDecorateInfoTemp() {
		return decorateInfoTemp;
	}

	public void setDecorateInfoTemp(BeanShopDecorateInfo decorateInfoTemp) {
		this.decorateInfoTemp = decorateInfoTemp;
	}

	public int getCreditScore() {
		return creditScore;
	}

	public void setCreditScore(int creditScore) {
		this.creditScore = creditScore;
	}
	@ManyToOne(cascade={CascadeType.REFRESH}, fetch=FetchType.LAZY)
	@JoinColumn(name="credit_rating_id")
	public BeanCreditRating getCreditRating() {
		return creditRating;
	}

	public void setCreditRating(BeanCreditRating creditRating) {
		this.creditRating = creditRating;
	}
	
}